<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>节点查询的演示</title>
<script type="text/javascript">
window.onload=function(){
	//1.根据id查询
	//var gz=document.getElementById("gz");
	//2.根据标签层次查询(节点关系)
	//2.1查询父节点
	//console.log(gz.parentNode);
	//2.2查询孩子,子节点
	//var oUl=document.getElementsByTagName("ul")[0];
	//console.log(oUl.childNodes);
	//把查询节点的方位缩小到ul内部(重点掌握)
	//var oLis=oUl.getElementsByTagName("li");
	//console.log(oLis);
	//2.3查询兄弟节点
	//某节点.父亲.孩子们[index]
	//var gz=document.getElementById("gz");
	//var jms=gz.parentNode
	//.getElementsByTagName("li")[4];
	//console.log(jms);
	//2.4根据name属性查询节点
	//一般用于查询一组单选/多选
	var radios=document.getElementsByName("gender");
	console.log(radios);
}
</script>
</head>
<body>
	<ul>
		<li>北京</li>
		<li>上海</li>
		<li id="gz">广州</li>
		<li>深圳</li>
		<li>佳木斯儿</li>
		<li>葫芦岛</li>
	</ul>
	<div>
		<input type="radio" name="gender">男
		<input type="radio" name="gender">女
	</div>
</body>
</html>












